﻿using System;
using System.Text;

namespace dotHTML.HTML {
    /// <summary>
    /// Defines a collection of HTML frames.
    /// </summary>
    [Serializable]
    [Obsolete("Deprecated in HTML5 - use <div>s and CSS or <iframe>s instead.")]
    public class FrameSet : Element {
        private int? _rows;
        private int? _cols;

        /// <summary>
        /// Determines the number of rows in this frameset.
        /// </summary>
        public int? Rows {
            get { return _rows; }
            set { _rows = value; }
        }

        /// <summary>
        /// Determines the number of columns in this frameset.
        /// </summary>
        public int? Cols {
            get { return _cols; }
            set { _cols = value; }
        }

        /// <summary>
        /// Gets a formatted string of all local attributes of this element
        /// (not including the base attributes).
        /// </summary>
        /// <param name="sb">The StringBuilder to write this element's
        /// attribute data to.</param>
        protected override void WriteLocalAttributes(StringBuilder sb) {
            AttributeWriter.Write(sb, _rows, "rows");
            AttributeWriter.Write(sb, _cols, "cols");
        }
    }
}
